package sjtu.ist.warehouse4ws.dao.cust;

import java.util.List;

import org.springframework.orm.hibernate3.HibernateTemplate;

import sjtu.ist.warehouse4ws.dao.BaseDaoHibernate;
import sjtu.ist.warehouse4ws.dao.RolepermissionsDao;
import sjtu.ist.warehouse4ws.model.CustRolepermissions;

public class CustRolepermissionsDaoHibernate extends BaseDaoHibernate<CustRolepermissions> implements CustRolepermissionsDao{
	@Override
	public Integer save(CustRolepermissions rolepermissions) {
		// TODO Auto-generated method stub
		getHibernateTemplate().setFlushMode(HibernateTemplate.FLUSH_EAGER); 
		return (Integer)getHibernateTemplate().save("CustRolepermissions",rolepermissions) ;
	}

	@Override
	public List findById(String id) {
		// TODO Auto-generated method stub
		return (List<CustRolepermissions>)getHibernateTemplate().find("from CustRolepermissions r where r.roleid='"+id+"'");
	}
}
